import React, { useState, useEffect } from 'react'

export default () => {
  const [count, setCount] = useState(0)

  useEffect(() => {
    document.title = `You clicked ${count} times`
  }, [count])

  return (
    <div>
      <h2>demo02</h2>
      <button onClick={() => setCount(count + 1)}>click me</button>
    </div>
  )
}